package com.ruoyi.Processor;

import com.ruoyi.common.entity.Project;
import org.jsoup.nodes.Element;

import java.util.ArrayList;
import java.util.List;

// 处理器注册表
class ProcessorRegistry {
    private List<ContentProcessor> processors = new ArrayList<>();
    
    public void registerProcessor(ContentProcessor processor) {
        processors.add(processor);
    }
    
    public void processElement(Element element, Project project) {
        for (ContentProcessor processor : processors) {
            if (processor.canProcess(element)) {
                processor.process(element, project);
                break;
            }
        }
    }
}